//
//  LoginViewController.m
//  e律师
//
//  Created by 韦淋 on 2017/5/15.
//  Copyright © 2017年 test. All rights reserved.
//

#import "LoginViewController.h"
#import "NetworkingManager.h"
#import "RetrievalViewController.h"

@interface LoginViewController ()
@property (nonatomic, strong) UIImageView *backGroundImageView;
@property (nonatomic, strong) UIImageView *logoImageView;
@property (nonatomic, strong) UITextField *accountField;
@property (nonatomic, strong) UITextField *passWordField;
@property (nonatomic, strong) UIButton *loginButten;
@property (nonatomic, strong) UIButton *registerButten;
@property (nonatomic, strong) UIButton *forgetPasswordButton;
@property (nonatomic, strong) UITextView *infoTextView;
@end

@implementation LoginViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self InitializeInterface];
}

- (void)InitializeInterface{
    [self.view addSubview:self.backGroundImageView];
    [self.view addSubview:self.logoImageView];
    [self.view addSubview:self.accountField];
    [self.view addSubview:self.passWordField];
    [self.view addSubview:self.loginButten];
    [self.view addSubview:self.registerButten];
    [self.view addSubview:self.forgetPasswordButton];
    [self.view addSubview:self.infoTextView];
}
#pragma mark - ButtonTarget
- (void)pushToNext:(UIButton *)sender{
    NSLog(@"1");
    RetrievalViewController *RVC = [[RetrievalViewController alloc] init];
    [self.navigationController pushViewController:RVC animated:YES];
}
#pragma mark - Getter/Setter
- (UIImageView *)backGroundImageView{
    if (!_backGroundImageView) {
        //        _backGroundImageView = [[UIImageView alloc] initWithImage: ];
    }
    return _backGroundImageView;
}
- (UIImageView *)logoImageView{
    if (!_logoImageView) {
        _logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 64, 200, 100)];
        _logoImageView.backgroundColor = [UIColor blueColor];
    }
    return _logoImageView;
}
- (UIButton *)forgetPasswordButton{
    if (!_forgetPasswordButton) {
        _forgetPasswordButton = [[UIButton alloc] initWithFrame:CGRectMake(230, 330, 100, 50)];
        _forgetPasswordButton.backgroundColor = [UIColor grayColor];
        [_forgetPasswordButton addTarget:self action:@selector(pushToNext:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _forgetPasswordButton;
}
- (UITextField *)accountField{
    if (!_accountField) {
        _accountField = [[UITextField alloc] initWithFrame:CGRectMake(50, 200, 280, 50)];
        _accountField.backgroundColor = [UIColor redColor];
        
        _accountField.font = [UIFont systemFontOfSize:15];
        _accountField.layer.cornerRadius = 5;
        _accountField.layer.masksToBounds = YES;
        _accountField.keyboardType = UIKeyboardTypeNumberPad;
//        _accountField.returnKeyType = UIReturnKeySearch;//设置按键类型
        _accountField.enablesReturnKeyAutomatically = YES;//无文字就灰色不可点
    }
    return _accountField;
}

- (UITextField *)passWordField{
    if (!_passWordField) {
        _passWordField = [[UITextField alloc] initWithFrame:CGRectMake(50, 270, 280, 50)];
        _passWordField.backgroundColor = [UIColor redColor];
        
        _passWordField.font = [UIFont systemFontOfSize:15];
        _passWordField.layer.cornerRadius = 5;
        _passWordField.layer.masksToBounds = YES;
//        _passWordField.keyboardType = UIKeyboardTypeNumberPad;
        _passWordField.returnKeyType = UIReturnKeySearch;//设置按键类型
        _passWordField.enablesReturnKeyAutomatically = YES;//无文字就灰色不可点
    }
    return _passWordField;
}
- (UIButton *)loginButten{
    if (!_loginButten) {
        _loginButten = [[UIButton alloc] initWithFrame:CGRectMake(50, 400, 130, 50)];
        _loginButten.backgroundColor = [UIColor blueColor];
        
    }
    return _loginButten;
}

- (UIButton *)registerButten{
    if (!_registerButten) {
        _registerButten = [[UIButton alloc] initWithFrame:CGRectMake(200, 400, 130, 50)];
        _registerButten.backgroundColor = [UIColor greenColor];
        
    }
    return _registerButten;
}
- (UITextView *)infoTextView{
    if (!_infoTextView) {
        _infoTextView = [[UITextView alloc] initWithFrame:CGRectMake(50, 610, 300, 50)];
        _infoTextView.backgroundColor = [UIColor whiteColor];
        _infoTextView.text = @"浙江律联信息科技有限公司";
        _infoTextView.textAlignment = NSTextAlignmentCenter;
    }
    return _infoTextView;
}
@end
